subroutine outnorm(mx,bl,x,Cu,acc_Cu,string,snum)
implicit none
    integer mx,bl,i
    integer snum

    real(8) x(-bl:mx+bl),Cu(-bl:mx+bl),acc_Cu(-bl:mx+bl)

    real(8) norm1,norm2,norm0

    real(8) one,two

    character(len=snum) string

        one=1.d0
        two=2.d0
        norm1=0.d0
        norm2=0.d0
        norm0=0.d0
        do i=0,mx
            norm1=dabs(acc_Cu(i)-Cu(i))+norm1
            norm2=(acc_Cu(i)-Cu(i))**two+norm2
            norm0=max(dabs(acc_Cu(i)-Cu(i)),norm0)
        enddo
        norm1=two*norm1/dble(mx)
        norm2=sqrt(two*norm2/dble(mx))

    open(100,file=string,status='replace')
    !do i=0,mx
        write(100,"(3(2xd20.10))") norm0,norm1,norm2
    !enddo
    close(100)
endsubroutine